package com.lcb.acm;

import java.util.Scanner;

public class Test0001 {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        String str = sc.nextLine();
        str = str.toUpperCase();
        int start = str.length();
        String str1 = sc.nextLine();
        str1 = str1.toUpperCase();
        str = str.replaceAll(str1, "");
        int end = str.length();
        System.out.println(start - end);
    }
}
